from google.appengine.ext import db

# List Model Class.
# The List contains a set of "List Entries": take a look to "ListEntryModel"
#    for more informations (listentrymodel.py)
class ListModel(db.Model):
   # Title (string and mandatory)
   title = db.StringProperty(required=True)
   # Description (text)
   description = db.TextProperty()
   # Tags (list of string (tag))
   tags = db.StringListProperty()
   # Visibility (string that can be only either "private" or "public" or "shared"
   visibility = db.StringProperty(required=True,
                                  choices=set(["private", "public", "shared"]),
                                  default="private")
   # Creation Date (date and mandatory, with default value "now")                               
   creation_date = db.DateTimeProperty(required=True, auto_now_add=True)
   # Completion Date (date) - This will be set when the last List Entry is Done
   #   Default value must be "None"
   completion_date = db.DateTimeProperty(default=None)
   # Due Date (date)
   #   Default value must be "None"
   due_date = db.DateTimeProperty(default=None)
   # Owner (user and mandatory)
   owner = db.UserProperty(required=True)
   # Max "order" value for the List Entries referring to this List.
   # It needs to be updated every time there is a New Entry AND when
   # a Reordering happens.
   entries_max_order = db.IntegerProperty(required=True, default=0)
